# Quantitative test of diffusion on 3D surfaces
# units are nanometer and milliseconds

define SEED 1
define NMOL 1000000		# use 100 for picture, 1000000 for validation

define VMOL 60 10 445	# point within triangle 1

graphics opengl_better
light room ambient 0 0 0
light 0 position -1 1 1 0
light 0 diffuse 0.5 0.5 0.5
light 0 ambient 0.5 0.5 0.5
light 0 specular 0.5 0.5 0.5

random_seed SEED
gauss_table_size 65536

dim 3
boundaries x -500 500
boundaries y -500 500
boundaries z -500 500

boxsize 1000

species red green

molecule_lists redlist greenlist
mol_list red(all) redlist
mol_list green(all) greenlist

difc red(all) 100	# 100 nm^2/ms = 0.1 um^2/s
difc green(all) 30000	# 300x faster than red to account for shorter time

color red(all) red
color green(all) green
display_size red(all) 5
display_size green(all) 0

time_start 0
time_stop 300
time_step 1

frame_thickness 0

start_surface surf1
color both lightgrey
polygon both fe
shininess both 10
thickness 2
read_file trispheretriangles.txt
end_surface

surface_mol NMOL red(up) surf1 tri tri1  VMOL
surface_mol NMOL green(up) surf1 tri tri1  VMOL

output_files FILEROOTout.txt stdout
output_format csv
cmd @ 1 set difc green(all) 0

cmd A molcountspacepolarangle red(all) 0 0 0 VMOL 400 500 90 0 FILEROOTout.txt
cmd A molcountspacepolarangle green(all) 0 0 0 VMOL 400 500 90 0 FILEROOTout.txt

end_file

